{% extends "base0.html" %}

{% block title %}
    <title>修改文章</title>
{% endblock %}

{% block body %}
    <!-- 页面顶部导航栏 -->
    <div class="header">
        {% load my_tags %}
        {% get_header_style request %}
    </div>
    <!-- 左侧边栏 -->
    <div class="col-md-3">
        {% load my_tags %}
        {% get_side_left_manager_style request username %}
    </div>
    <!-- 文本编辑器 -->
    <div class="col-md-9">
        <form action="" method="post">
            {% csrf_token %}
            <span class="text-muted">修改文章</span>
            <hr>
            <div class="form-group">
                <span>标题</span>
                <input type="text" class="form-control" name="title" placeholder="标题" value="{{ article_obj.title }}">
            </div>
            <div class="form-group">
                <span>自定义文章标签</span>
                <input type="text" class="form-control" name="tag" placeholder="标签（多标签以空格分隔）" value="{{ tags }}">
            </div>
            <div class="form-group">
                <span>内容</span>
                <textarea id="editor_id" name="content" class="form-control">{{ article_obj.content }}
                </textarea>
            </div>
            <button type="submit" class="btn btn-info btn-send-article">发布</button>
        </form>
        <script>
            KindEditor.ready(function (K) {
                window.editor = K.create('#editor_id', {
                    items: [
                        'source', '|', 'undo', 'redo', '|', 'preview', 'template', 'code',
                        '|', 'justifyleft', 'justifycenter', 'justifyright',
                        'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', '|', 'fullscreen',
                        'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
                        'italic', 'underline', 'strikethrough', 'lineheight', '|',
                        'table', 'hr', 'emoticons', 'baidumap',
                        'anchor', 'link', 'unlink', '|', 'about'
                    ],
                    width: '100%',
                    height: '300',
                    resizeType: 0,
                });
            });
        </script>
    </div>
{% endblock %}